package com.gongj.rabbitboot.controller;

import com.gongj.rabbitboot.dto.PayDTO;
import com.gongj.rabbitboot.rabbitmq.producer.RabbitSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RabbitController {

    @Autowired
    RabbitSender rabbitSender;

    @GetMapping("/sendPay")
    public String sendPay(){
        PayDTO payDTO = new PayDTO();
        payDTO.setMoney("8888888");
        payDTO.setPayBank("***银行");
        payDTO.setPayId(123541880889922L);
        payDTO.setPayTime("2029-11-18 14:15:48 654");
        rabbitSender.send(payDTO);
        return "success";
    }
}
